using System;
using System.Collections.Generic;
using MvcCms.Data;
using System.Linq;

namespace MvcCmsProjectTracker.Service
{
    public interface ITicketService
    {
        void Save();

        bool CreateTicket(Ticket ticketToCreate);
        bool EditTicket(Ticket ticketToEdit);

        bool AddTicket(Ticket ticket);
        bool AddTicketAttachment(TicketAttachment attachment);
        bool AddTicketComment(TicketComment comment);
        bool AddTicketHistory(TicketHistory history);
        bool AddTicketNotification(TicketNotification notification);

        bool DeleteTicket(Ticket ticketToDelete);
        bool DeleteTicketAttachment(TicketAttachment attachment);
        bool DeleteTicketComment(TicketComment comment);
        bool DeleteTicketHistory(TicketHistory history);
        bool DeleteTicketNotification(TicketNotification notification);

        Ticket GetTicket(int ticketID);
        TicketAttachment GetTicketAttachment(int attachmentID);
        TicketComment GetTicketComment(int commentID);
        TicketHistory GetTicketHistory(int historyID);
        TicketNotification GetTicketNotification(int notificationID);

        IQueryable<TicketAttachment> GetTicketAttachments(int ticketID);        
        IQueryable<TicketComment> GetTicketComments(int ticketID);
        IQueryable<TicketHistory> GetTicketHistories(int ticketID);                
        IQueryable<TicketNotification> GetTicketNotifications(int ticketID);
        IQueryable<Ticket> GetTicketsByPriority(int projectID, int priorityID);
        IQueryable<Ticket> GetTicketsByProject(int projectID);
        IQueryable<Ticket> GetTicketsByStatus(int projectID, int statusID);
        IQueryable<Ticket> GetOpenHelpDeskTickets();
        IQueryable<Ticket> GetMyTickets(Guid userId);
    }
}